import request from '@/utils/request'

/**
 *
 * 套餐管理
 *
 **/

export const getSetmealPage = (params) =>{
  return request({
    url: '/setmeal/page',
    method: 'GET',
    params: params
  })
}


// 新增接口
export const addSetmeal = (params) => {
  return request({
    url: '/setmeal',
    method: 'post',
    data: { ...params }
  })
}

//根据id查询零食套餐详情
export const querySetmealById = (id) =>{
  return request({
    url:`/setmeal/${id}`,
    method: 'GET'
  }) 
}

  
// 修改数据接口
export const editSetmeal = (params) => {
  return request({
      url: '/setmeal',
      method: 'put',
      data: { ...params }
  })
}


//套餐启售停售
export const startOrStopSetmeal = (params) => {
  return request({
      url: `/setmeal/status/${params.status}`,
      method: 'POST',
      params: {id: params.id}
  })
}


// 删除接口
export const deleteSetmeal = (ids) => {
  return request({
    url: '/setmeal',
    method: 'delete',
    params: { ids }
  })
}
